/**
 * @copyright   Kevin
 * @license     LGPL 3.0
 * @author      Kevin
 * @checkout    https://gitee.com/bigearrabbit/KevinQt.git
 * @file        KevinListItem.cpp
 */

// Qt
#include <QDebug>

// std
#include <iostream>

// Kevin
#include "KevinListItem.h"

namespace Kevin {
const int ListItem::count = 5;
//--------------------------------------------------------------------
ListItem::ListItem()
    // clang-format off
    //START KEVIN CAA WIZARD SECTION KevinListItem PARAM CONSTRUCTOR
    : Title(),
      Type(),
      IID(),
      IconSource(),
      SubType(0)
    //END KEVIN CAA WIZARD SECTION KevinListItem PARAM CONSTRUCTOR
// clang-format on
{
}
//--------------------------------------------------------------------
ListItem::ListItem(const QString& title, const QString& type, const QString& iid,
                   const QString& source, int sub)
    : Title(title)
    , Type(type)
    , IID(iid)
    , IconSource(source)
    , SubType(sub) {
}
//--------------------------------------------------------------------
ListItem::~ListItem() {
    // clang-format off
    //START KEVIN CAA WIZARD SECTION KevinListItem PARAM DESTRUCTOR
    //Title = ""; //1
    //Type = ""; //3
    //IID = ""; //4
    //IconSource = ""; //2
    //SubType = 0; //5
    //END KEVIN CAA WIZARD SECTION KevinListItem PARAM DESTRUCTOR

    // clang-format on
}
//--------------------------------------------------------------------
ListItem::ListItem(const ListItem& iOriginal) {
    *this = iOriginal;
}
//--------------------------------------------------------------------
ListItem& ListItem::operator=(const ListItem& iOriginal) {
    // clang-format off
    //START KEVIN CAA WIZARD SECTION KevinListItem PARAM EQUAL
    this->Title = iOriginal.Title;
    this->Type = iOriginal.Type;
    this->IID = iOriginal.IID;
    this->IconSource = iOriginal.IconSource;
    this->SubType = iOriginal.SubType;
    //END KEVIN CAA WIZARD SECTION KevinListItem PARAM EQUAL

    // clang-format on
    return *this;
}
//--------------------------------------------------------------------
void ListItem::clear() {
    *this = Kevin::ListItem();
}
//--------------------------------------------------------------------
QString ListItem::json() const {
    QString msg = "{\"Title\": \"" + Title + "\"";
    msg += ",\"Type\": \"" + Type + "\",";
    msg += ",\"IID\": \"" + IID + "\",";
    msg += ",\"IconSource\": \"" + IconSource + "\",";
    msg += QString(",\"SubType\": ") + SubType + "}";
    return msg;
}
} // namespace Kevin
